package com.libinyn.base.pms.config.db;


import org.jasypt.encryption.StringEncryptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;


/**
 * 数据库配置文件解密
 * @fileName: DefaultEncryptor.java
 * @author: bin.li01
 * @date: 2017/11/29 11:12
 * @version: v1.0.0
 */
@Component
public class DefaultEncryptor implements StringEncryptor {

	private static final Logger LOGGER = LoggerFactory.getLogger(DefaultEncryptor.class);

	private static final String KEY = "12345678";

	@Override
	public String encrypt(String message) {

		return DESBASE64.decodeValue(KEY, message);
	}

	@Override
	public String decrypt(String encryptedMessage) {


		return DESBASE64.decodeValue(KEY,encryptedMessage);
	}
}
